home *** CD-ROM | disk | FTP | other *** search
- Path: news.netspace.net.au!usenet
- From: randy@netspace.net.au (Patrick Liang)
- Newsgroups: comp.lang.c++
- Subject: Urgent help needed
- Date: 6 Feb 1996 07:17:12 GMT
- Organization: internet service
- Message-ID: <4f6v9o$ov6@otis.netspace.net.au>
- NNTP-Posting-Host: dialup-a1-13.mel.netspace.net.au
- X-Newsreader: WinVN 0.92.6+
-
- I am doing a program to convert a serial no to date format, the serial no is
- representing the seconds elapsed since 01/01/1970. and I using the Visual basic
- to call the DLL function(general from Borland C++ version 4).
-
- It seems there is no problem to creat the DLL in c
- program, no error message, but when I run the visual basic program which call the
- DLL that I created, it generate the GPF(general protection fault). the following
- is the program code.
-
- Please help . Thank you.
-
- /* This is the def file in C Using Borland C++ */
-
- LIBRARY TEST3
- DESCRIPTION "just testing"
- EXETYPE WINDOWS
- CODE PRELOAD MOVEABLE DISCARDABLE
- DATA PRELOAD MOVEABLE SINGLE
- HEAPSIZE 4096
- EXPORTS NUMTODATE
-
-
- /* this is the main c program Using Borland C++ */
-
- /* Demonstrates the functions */
-
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- #include <windows.h>
-
-
- char FAR PASCAL NUMTODATE(char *argv1)
- {
-
- struct tm *ptr;
- char *c, buf1[80];
- long l;
-
- l = atol(argv1);
-
- ptr = localtime(&l);
-
- c = asctime(ptr);
- puts(c);
-
- return *c;
- }
-
-
- /* this is the visual basic program */
-
-
- Declare Function NUMTODATE Lib "c:\test3.dll" (ByVal DateNum As String) As String
-
- MsgRtn = NUMTODATE(CodeInquire)
-
-
- =============================
-
-
-
-